import { CheckOutlined } from '@ant-design/icons';
import { Button, InputNumber, List, Popconfirm, TextArea } from 'antd';
import React from 'react';
export const MyPopConfirm: React.FC<any> = (props: {
  actionType: number;
  text: string;
  children: any;
}) => {
  return (
    <Popconfirm
      title={paragraph ? '' : modalTitle}
      icon={false}
      disabled={false}
      showCancel={false}
      description={
        <div>
          生成字数约
          <InputNumber
            min={1}
            style={{ width: '100px', margin: '8px', background: '#F9FAFF' }}
            onChange={handleNum}
          />
          字
          {actionType === 1 && (
            <TextArea
              rows={4}
              showCount
              placeholder="请给一些重写的方向..."
              onChange={(e) => {
                setRequireContent(e.target?.value);
              }}
            />
          )}
          {actionType === 6 && (
            <List
              itemLayout="horizontal"
              dataSource={HOTS}
              renderItem={(item, index) => (
                <List.Item style={{ color: 'blue', marginTop: '0' }} onClick={() => setHot(index)}>
                  <a style={index === hot ? { color: '#397BFF' } : { color: '#000' }}>{item}</a>
                  {index === hot && <CheckOutlined color="#397BFF" />}
                </List.Item>
              )}
            />
          )}
        </div>
      }
      okText="生成"
      onConfirm={handleOk}
    >
      <Button style={{ ...styles.button }} onClick={() => handleAction(props.actionType)}>
        <img src={props.icon} style={styles.icon} />
        {props.text}
      </Button>
      {props.children}
    </Popconfirm>
  );
};
